﻿#include"head and macro.h"
#include"Class.h"
#include"function declaration.h"
#include"struct.h"

int main()
{
	 //全局变量声明：
     //开始--------

	extern MyStruct s;

    //结束--------
	//****************从这里开始写主函数代码**********************
	//*************************************************************************

	char *s1, *s2;
	s1 = new char [100];
	s2 = new char[100];
	cout << "请分别输入主串和子串" << endl;
	cin >> s1>>s2;

	//*************************************************************************
	runstart();
	//*************************计时开始***************************************
	
	int a = mate(s1,s2);
	if (a == 0)
		cout << "匹配失败" << endl;
	else
		cout << "匹配成功,位置：" << a << endl << endl;
	int n = mate("123456", "345");
	if (n == 0)
		cout << "匹配失败" << endl;
	else
		cout << "匹配成功,位置：" << n << endl;
	delete[]s1;
		delete[]s2;

	//*************************计时结束***************************************
	runend();



	//***************************结束********************************
	rundisplay();                                                                   //计时结果显示
	_getch();
	//closegraph();
	// system("pause");
	//Sleep(10000);
	return 0;
}
